package com.smart.stock.module.maindata.controller;

import com.smart.stock.module.maindata.services.BigScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author chenguoxiang
 * @create 2019-09-20 14:20
 **/
@Api(tags = "大屏接口")
@Slf4j
@RequestMapping("/big-screen")
@Controller
public class BigScreenController {

    @Autowired
    private BigScreenService bigScreenService;

    @ApiOperation(value = "index，返回大屏url")
    @GetMapping("/index")
    public String index(){
        return "/big-screen/index";
    }

    @ApiOperation(value = "上证指数")
    @ResponseBody
    @GetMapping("/getIndexSH")
    public String getIndexSH() throws Exception {
        return bigScreenService.getIndexSH();
    }

    @ApiOperation(value = "深证指数")
    @ResponseBody
    @GetMapping("/getIndexSZ")
    public String getIndexSZ() throws Exception {
        return bigScreenService.getIndexSZ();
    }

    @ApiOperation(value = "科创板指数")
    @ResponseBody
    @GetMapping("/getIndexKCB")
    public String getIndexKCB() throws Exception {
        return bigScreenService.getIndexKCB();
    }

    @ApiOperation(value = "创业板指数")
    @ResponseBody
    @GetMapping("/getIndexCYB")
    public String getIndexCYB() throws Exception {
        return bigScreenService.getIndexCYB();
    }

    @ApiOperation(value = "腾落线")
    @ResponseBody
    @GetMapping("/getIndexTengLuoXian")
    public String getIndexTengLuoXian() throws Exception {
        return bigScreenService.getIndexTengLuoXian();
    }

}
